package homework.api05.exercise01;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OosDemo {
    public static void main(String[] args) throws IOException {
        String name = "范海辛";
        int age = 23;
        String gender = "男";
        String[] othrerInfo = {"帅","有钱","会讲英文"};
        Person person = new Person(name,age,gender,othrerInfo);

        FileOutputStream fos = new FileOutputStream("person_1.obj");
        ObjectOutputStream oos = new ObjectOutputStream(fos);

        oos.writeObject(person);
        System.out.println("写出完毕");
        oos.close();

    }
}
